﻿using System.Collections.Generic;
using UnityEngine;
using GraphProcessor;
using IQIGame.Onigao.Logic;

namespace IQIGame.Onigao.GamePlay.Editors
{
    public class SkillPartBaseNode : IDGenerateNode
    {
        [Output(name = "Next")] public SkillEditorCondition Next;
        [Output("技能效果")] public SkillPartConfig self;

        [InspectorName("AI移动方式")]public int aiMoveType;
        public string timeline;
        public override string name => SkillEditorConst.MainPart;
        protected virtual ESkillPartType partType { get; }

        protected override void Process()
        {
            base.Process();

            var rPart = new SkillPartConfig
            {
                guid = this.GenerateID(),
                name = this.GetCustomName(),
                timeline = this.timeline,
                partType = (int)this.partType,
                effectives = new List<SkillEffectiveConfig>(),
                aiMoveType = this.aiMoveType,
            };

            this.self = rPart;
            this.Next = new SkillEditorCondition()
            {
                part = this.self
            };

            SkillEditorBlackboard.Instance.AddPart(rPart);
        }
    }
}